package com.atguigu.springcloud.service;

import com.atgugui.springcloud.entities.CommonResult;
import com.atgugui.springcloud.entities.Payment;
import feign.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author: lihan
 * @Date : 2021/12/8- 12
 * @DESCRIPTION: com.atguigu.springcloud.service
 * @version: 1.0
 */
@Component
@FeignClient(value = "cloud-paymnet-service")
public interface PaymentFeignService {
    @PostMapping("/payment/create")
    public CommonResult create(@RequestBody Payment payment);

    @GetMapping("/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    @GetMapping("/payment/feign/timeout")
    public String getFeignTimeOut();
}
